﻿@using ThirdPrize.Models;

@model ComicListModel

@{
    ViewBag.Title = "Comics";
}


<article class="comic">
    <table width="100%">
        <tr>
            <td colspan="2" class="tab-left">
                <img src="~/Images/Nurbs/NurbsLogo.png" />
            </td>
            <td colspan="2" class="tab-right">
                @if (User.IsInRole("Administrator"))
                {
                    <a href="/Nurbs/ComicList">Manage Comic Episodes</a>
                }

            </td>
        </tr>
        <tr>
            <td class="tab-left">@Html.ActionLink("Latest", "Index", "Nurbs")</td>
            <td class="tab-left">@Html.ActionLink("About", "About", "Nurbs")</td>
            <td class="tab-right">@Html.ActionLink("Archive", "Archive", "Nurbs")</td>
            <td class="tab-right"><a href="~/NurbsFeed.XML">Rss Feed</a></td>
        </tr>
    </table>
    <h2>Existing comics</h2>

    <table>
        <tr>
            <td class="comiccol1">
                <h3>No</h3>
            </td>
            <td class="comiccol2">
                <h3># & Format</h3>
            </td>
            <td class="comiccol3">
                <h3>Title</h3>
            </td>
            <td class="comiccol4">
                <h3>Date</h3>
            </td>
            <td class="comiccol5">
                <h3>Comment</h3>
            </td>
            <td class="comiccol6">
                <h3>AltText</h3>
            </td>
        </tr>
        @foreach (var r in Model.AllEpisodes)
        {
            <tr>
                <td><a class="editlink" href="ComicList?episodeToEdit=@r.ComicNo">@r.ComicNo</a> <a class="deletelink" href="DeleteEpisode?episodeToDelete=@r.ComicNo">X</a></td>
                <td>@r.NoPanels / @r.ImageType</td>
                <td>@r.Title</td>
                <td>@(r.PublishDate.HasValue ? r.PublishDate.Value.ToShortDateString() : "")</td>
                <td>@r.Comment</td>
                <td>@r.AltText</td>
                <td></td>

            </tr>
        }

    </table>

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- ComicAds -->
    <ins class="adsbygoogle"
        style="display: inline-block; width: 728px; height: 90px"
        data-ad-client="ca-pub-0574130303791064"
        data-ad-slot="2863558459"></ins>
    <script>
        (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
</article>









<aside>
    <table class="hilight-table">
        <tr>
            <td class="hilight-cell">
                <h2>New Comics</h2>
                @using (Html.BeginForm("UpdateEpisode", "Nurbs", FormMethod.Post))
                {
                    <label>Comic No</label>@Html.TextBox("comicNo", Model.ComicNo)  <br />
                    <label>No of Panels</label>@Html.TextBox("noPanels", Model.NoPanels)<br />
                    <label>Title</label>@Html.TextBox("title", Model.Title)<br />
                    <label>Alt Text?</label>@Html.TextArea("altText", Model.AltText)<br />
                    <label>Comment</label>@Html.TextArea("comment", Model.Comment)<br />
                    <label>Image Format? E-F.(J=0, P=1, G=2)</label>@Html.TextBox("ImageType", Model.ImageType)<br />
                    <label>Date (dd/mm/yyyy)</label>@Html.TextBox("publishDate", (Model.PublishDate.HasValue ? Model.PublishDate.Value.ToShortDateString() : DateTime.Now.ToShortDateString()))<br />
                    <input type="submit" value="Add/Update" />
                }
            </td>
        </tr>
    </table>

    <table class="hilight-table">
        <tr>
            <td class="hilight-cell">
                <h2>Images Upload</h2>
                @using (Html.BeginForm("UploadImages", "Nurbs", FormMethod.Post, new { enctype = "multipart/form-data" }))
                {
                    <input type="file" name="files" id="file1" />
                    <input type="file" name="files" id="file2" />
                    <input type="file" name="files" id="file3" />
                    <input type="file" name="files" id="file4" />
                    <input type="submit" value="Upload" />
                }
            </td>
        </tr>
    </table>

</aside>


